﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="vcodeimg.ascx.cs" Inherits="ZF.WS.UserControls.vcodeimg" %>
<zf:TextBox runat="server" ID="tbVCode" class="sstxt"></zf:TextBox><img src="/ValidatePage.aspx"
    style="cursor: pointer" class='vcodeimg' onclick="refreshValidateCodeImage(this);" />
<span class="zx_" id="tbVCodeTip"></span>

    <script language='javascript' type="text/javascript">
        function refreshValidateCodeImage(ValidateCodeImageControl) {

            var url = ValidateCodeImageControl.src;
            if (url.indexOf("?code=") > -1) {
                url = url.split("?")[0];
            }
            ValidateCodeImageControl.src = url + '?code=' + randomNum(10);
        }
        function randomNum(n) {
            var rnd = '';
            for (var i = 0; i < n; i++)
                rnd += Math.floor(Math.random() * 10);
            return rnd;

        }
        $(function() {
            $(".vcodeimg")[0].click();

        });
    </script>